package com.initialize.pub.util;//package com.star.pub.util;
//
//import com.github.qcloudsms.SmsSingleSender;
//import com.github.qcloudsms.SmsSingleSenderResult;
//import com.github.qcloudsms.httpclient.HTTPException;
//import org.json.JSONException;
//import org.springframework.context.annotation.Bean;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//@Component
//public class SmsTService {
//
////    @Bean
////    public SmsTService SmsTService() {
////        SmsTService smsTService = new SmsTService();
////        return smsTService;
////    }
//
//    public boolean smsToUser(String phoneNumber, String param) {
//        try {
//            String[] params = new String[2];
//            params[0] = param;
//            params[1] = "2";
//            SmsSingleSender ssender = new SmsSingleSender(SMsTUtil.appid, SMsTUtil.appkey);
//
//            SmsSingleSenderResult smsSingleSenderResult = ssender.sendWithParam("86", phoneNumber,
//                    SMsTUtil.templateId, params, SMsTUtil.smsSign, "", "");
//            int fee = smsSingleSenderResult.fee;
//            if (fee == 1) {
//                return true;
//            }
//            return false;
//        } catch (HTTPException | JSONException | IOException e) {
//            // HTTP 响应码错误
//            e.printStackTrace();
//        }
//        return false;
//    }
//
//}
